const express = require('express')
const router = express.Router()



//引入登录注册函数
const { register, login } = require('../router_handle/user')
router.post('/register', register)
router.post('/login', login)

//引入首页信息函数
const { showIndex, searchIndex } = require('../router_handle/index')
router.get('/index', showIndex)
router.post('/index', searchIndex)

//引入相册信息函数
const { createAlbum, searchAlbum, showUserAlbums } = require('../router_handle/album')
router.post('/album', createAlbum)
router.get('/album', searchAlbum)
router.get('/showAlbum', showUserAlbums)

//引入相片信息函数
const { showUserPics, uploadPic } = require('../router_handle/pic')
router.get('/album/pic', showUserPics)
router.post('/album/upload', uploadPic)


//获取七牛云的token
const { getToken } = require('../utils/qiniu')
router.get('/qiniuToken', getToken)


//通过album_name获取id
const { getId } = require('../utils/getId')
router.post('/getAlbumId', getId)

//发布消息到首页
const { publicMessage } = require('../router_handle/public')
router.post('/public', publicMessage)

module.exports = router